package cn.edu.neusoft.demo.hospital2.Service.impl;

import cn.edu.neusoft.demo.hospital2.Dao.NoticeDao;
import cn.edu.neusoft.demo.hospital2.pojo.Notice;
import cn.edu.neusoft.demo.hospital2.Service.NoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class NoticeServiceImpl implements NoticeService {

    @Autowired
    private NoticeDao noticeDao;

    @Override
    public List<Notice> getAllNotices() {
        return noticeDao.getAllNotices();
    }

    @Override
    public Notice getNoticeById(Integer id) {
        return noticeDao.getNoticeById(id);
    }

    @Override
    public int addNotice(Notice notice) {
        return noticeDao.insert(notice);
    }

    @Override
    public int updateNotice(Notice notice) {
        return noticeDao.updateById(notice);
    }

    @Override
    public int deleteNotice(Integer id) {
        return noticeDao.deleteById(id);
    }
}